<?php
namespace catchAdmin\foundation\tables;

use catchAdmin\foundation\tables\forms\Factory;
use catcher\CatchTable;
use catcher\library\table\Actions;
use catcher\library\table\HeaderItem;
use catcher\library\table\Search;

class Operation extends CatchTable
{
    protected function form()
    {
        // TODO: Implement form() method.
        return Factory::create('operation');
    }

    protected function table()
    {
        // TODO: Implement table() method.
        return $this->getTable('Operation')
                    ->header([
                        HeaderItem::label()->selection(),
                        HeaderItem::label('手术编码')->prop('operationno'),
                        HeaderItem::label('手术代码')->prop('operationcode'),
                        HeaderItem::label('手术名称')->prop('name'),
                        HeaderItem::label('操作')->actions([
                            Actions::update(),
                            Actions::delete()
                        ])
                    ])
                    ->withActions([
                        Actions::create()
                    ])
                    ->withDialogWidth('35%')
                    ->withApiRoute('operation')
                    ->selectionChange()
                    ->render();
    }
}